#pragma once
#include <QStyledItemDelegate>
#include <QPainter>
#include <QApplication>

class GeneralDelegate : public QStyledItemDelegate
{
    Q_OBJECT
public:
    GeneralDelegate(QObject *parent = nullptr);
    void initStyleOption(QStyleOptionViewItem *option, const QModelIndex &index) const override;
    void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
    bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) override;
signals:
    void deleteRequested(const QModelIndex &index);
};